<?php

declare(strict_types=1);

namespace App\CustHub\Model;

use Mine\MineModel;

/**
 * @property int $id 
 * @property int $uid 
 * @property int $main_uid 
 * @property int $robot_type 企微号类型：0=个微  1=企微
 * @property string $room_wxid 中控群微信ID
 * @property string $remark 备注信息
 * @property array $listening_content 监听内容
 * @property int $is_auto_at_cust 回复自动@客户：0=否 1=是
 * @property int $status 方案状态：0=禁用 1=启用
 * @property int $robot_count 企微号数量
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 * @property-read null|ChRoom $room 
 */
class ChCtrlRoomScheme extends MineModel
{
    public const ENABLE =  1;

    public const DISABLE = 0;

    /**
     * The table associated with the model.
     */
    protected ?string $table = 'ch_ctrl_room_scheme';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'uid', 'main_uid', 'robot_type', 'room_wxid', 'remark', 'listening_content', 'is_auto_at_cust', 'status', 'robot_count', 'created_at', 'updated_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'uid' => 'integer', 'main_uid' => 'integer', 'robot_type' => 'integer', 'listening_content' => 'array', 'is_auto_at_cust' => 'integer', 'status' => 'integer', 'robot_count' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    public function room()
    {
        return $this->hasOne(ChRoom::class, 'room_wxid', 'room_wxid');
    }
}
